#include<iostream>
using namespace std;
string s;
int n;
int mp[30];
int main()
{
	cin >> s;
	for (auto x : s) {
		int t = x - 'a' + 1;
		mp[t]++;
	}
	int cnt = 0;
	for (int i = 1; i <= 26; i++) {
		if (mp[i])cnt++;
	}
	if (cnt == 1 || cnt > 4) {
		cout << "No" << endl;
	}
	else if (cnt == 2) {
		bool f = 0;
		for (int i = 1; i <= 26; i++) {
			if (mp[i]) {
				if (mp[i] < 2) {
					f = 1;
					break;
				}
			}
		}
		if (f)cout << "No" << endl;
		else cout << "Yes" << endl;
	}
	else if(cnt == 3) {
		bool f = 0;
		for (int i = 1; i <= 26; i++) {
			if (mp[i] >= 2) {
				f = 1;
				break;
			}
		}
		if (!f)cout << "No" << endl;
		else cout << "Yes" << endl;
	}
	else {
		cout << "Yes" << endl;
	}
	return 0;
}